Adding fortitude rules 1#370
Conversation
Matthew Hambley (MatthewHambley)
left a comment
There was a problem hiding this comment.
Code Owner Review: Looks good to me.
Thomas Bendall (tommbendall)
left a comment
There was a problem hiding this comment.
No objections from me -- this all looks positive! I haven't worked through all of the rules but hoping I'll generally agree with them when I encounter them!
Andrew Coughtrie (andrewcoughtrie)
left a comment
There was a problem hiding this comment.
This looks good to me, just the one suggestion to try and make the toml file more readable.
I have added the suggested changes and elaborated on some of the rule descriptions a bit more in [fe56140] |
Andrew Coughtrie (andrewcoughtrie)
left a comment
There was a problem hiding this comment.
This all looks good to me now.
Pierre Siddall (Pierre-siddall)
left a comment
There was a problem hiding this comment.
Thanks mo-lucy-gordon, this looks good to head into testing to me and thanks for updating files containing fortitude errors.
Pierre Siddall (Pierre-siddall)
left a comment
There was a problem hiding this comment.
Reapproval for pipeline
9e2718e
into
MetOffice:main
PR Summary
Sci/Tech Reviewer: Andrew Coughtrie (@andrewcoughtrie)
Code Reviewer: Pierre Siddall (@Pierre-siddall)
I have added rules to a fortitude configuration file so that more checks are run on the code. This will reduce the amount of new style issues getting onto the trunks.
N.B. Although these fortitude tests being added passed before submission for review, any new additions to the trunk after that may cause fortitude errors, so those will be need to be fixed by me/the developer while the trunk is reserved for this ticket to be committed.
There are lots of exceptions (check.per-file-ignores) listed in the configuration files which stop certain files being tested with certain rules, so the tests all pass. Some style issues have been fixed in this ticket but the rest of these style issues can be fixed in batches with proceeding tickets.
Here is a full list of the rules added and what they check for:
#E000 io-error
#E001 syntax-error
#C001 missing implicit none,
#C021 real literal missing kind suffix
#C022 implicit-real-kind
#C031 magic-number-in-array-size
#C032 magic unit in IO statement
#C043 missing-action-specifier
#C051 trailing-backslash
#C071 assumed-size
#C072 character has assumed size but does not have intent(in)
#C081 initialisation-in-declaration
#C091 external-procedure
#C082 pointer-initialisation-in-declaration
#C092 procedure-not-in-module
#C121 use-all
#C132 default-public-accessibility
#C141 missing-exit-or-cycle-label
#OB011 common-block
#OB021 entry-statement
#OB051 pause-statement
#OB061 deprecated-character-syntax
#MOD001 double-precision
#MOD021 deprecated-relational-operator
#S101 trailing-whitespace
#S071 missing-double-colon
#PORT011 literal-kind
#PORT012 literal-kind-suffix
#PORT021 star-kind
#FORT001 invalid-rule-code-or-name
#FORT002 unused-allow-comment
#FORT003 redirected-allow-comment
#FORT004 duplicated-allow-comment
#FORT005 disabled-allow-comment
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_core - lc_add_r1/run10
Suite Information
Task Information
✅ succeeded tasks - 402
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review